# coding=utf-8
# 全世界最帅的帅哥
from flask import jsonify, current_app


def register_error_handlers(app):
    @app.errorhandler(500)
    def handle_500(e):
        current_app.logger.error(str(e))
        return jsonify({'error': 'Internal Server Error'}), 500

    @app.errorhandler(404)
    def handle_404(e):
        current_app.logger.error(str(e))
        return jsonify({'error': 'Internal Server Error'}), 404
